package com.zx._05_代理.cglibProxy;

import java.lang.reflect.Method;
import net.sf.cglib.proxy.MethodInterceptor;
import net.sf.cglib.proxy.MethodProxy;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;


public class MyIntercept3 implements MethodInterceptor {

    private final static Logger LOGGER = LoggerFactory.getLogger(MyIntercept3.class);

    @Override
    public Object intercept(Object o, Method method, Object[] objects, MethodProxy methodProxy) throws Throwable {
        LOGGER.info("33333 before");
        methodProxy.invokeSuper(o, objects);
        //methodProxy.invoke(o, objects);//不能使用这个。这个地方会出现递归执行的问题，导致栈溢出
        LOGGER.info("33333 after");
        return o;
    }
}
